package de.ars.client.paintSystems;

import javax.microedition.lcdui.Graphics;

import com.sun.lwuit.Font;

public class StringPainter
{
    private int screenWidth = 00;
    private int screenHeight = 00;
    
    public StringPainter(int screenWidth, int screenHeight)
    {
        this.screenWidth = screenWidth;
        this.screenHeight = screenHeight;
    }

    public void drawString(Graphics g, String text, int x, int y)
    {
        if (x+g.getTranslateX() < screenWidth && y+g.getTranslateY() < screenHeight)
            g.drawString( text, x, y, Graphics.TOP | Graphics.LEFT );
    }
    
    public void drawMessage(Graphics g, String[] text, int x, int y,Font font)
    {
    	for (int i=0;i<text.length;i++)
    	{
    		g.drawString(text[i], x, y, Graphics.TOP | Graphics.LEFT);
    		y += font.getHeight();
    	}
    }
}
